package com.zes.answers.service.Impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zes.answers.domain.TbUser;
import com.zes.answers.mapper.TbUserMapper;
import com.zes.answers.service.UserService;

/**
 * TODO 类描述
 *
 * @author honghe
 */
@Service
public class UserServiceImpl implements UserService {

    @Resource
    TbUserMapper userMapper;

    @Override
    public TbUser findUserById(Long id) {
        TbUser user = new TbUser();
        try {
            user  = userMapper.selectByPrimaryKey(id);
        }catch (Exception e){
            e.printStackTrace();
        }
        return user;
    }

    @Override
    public List<TbUser> findAllUser() {
        List<TbUser> userList = userMapper.findAllUser();
        System.out.println("数组长度为："+userList.size());
        return userList;
    }

}
